<?php

/*
  | --------------------------------------------------------------------------------------------------
  | <fornecedor_view>
  |
  | Desenvolvedor:	Eduardo Sirangelo
  | E-mail:		sirangelos@ibest.com.br
  | Descrição:
  |	-
  | Quality is Everyting
  | --------------------------------------------------------------------------------------------------
 */
?>
<script src="<?=base_url()?>public/js/cadastros/fornecedores.js"></script>

<section class="grid_12">
    
    <div class="block-border"><form class="block-content form" id="table_form" method="post" action="">
            
            <div class="h1 with-menu">
                <h1>Ações - Fornecedores</h1>
                <div class="menu">
                    <img src="<?=base_url()?>public/images/menu-open-arrow.png" width="16" height="16"/>
                    <ul>
                    </ul>
                </div>
                <?=anchor("/cadastros/novo_fornecedor","<img src='" . base_url() . "public/images/icons/fugue/plus-circle-blue.png' width='16' height='16'> Novo Fornecedor")?>
        </div>

            <table class="table sortable no-margin" cellspacing="0" width="100%">

                <thead>
                        <tr>
                                <th class="black-cell"><span class="loading" id="ajax-loading"></span></th>
                                <th scope="col">
                                    <span class="column-sort">
                                            <a href="#" title="Sort up" class="sort-up"></a>
                                            <a href="#" title="Sort down" class="sort-down"></a>
                                    </span>
                                    Cód. Fornecedor
                                </th>
                                <th scope="col">
                                    <span class="column-sort">
                                            <a href="#" title="Sort up" class="sort-up"></a>
                                            <a href="#" title="Sort down" class="sort-down"></a>
                                    </span>
                                    Razão Social
                                </th>
                                <th scope="col">
                                    <span class="column-sort">
                                            <a href="#" title="Sort up" class="sort-up"></a>
                                            <a href="#" title="Sort down" class="sort-down"></a>
                                    </span>
                                    Contato
                                </th>
                                <th scope="col">
                                    <span class="column-sort">
                                            <a href="#" title="Sort up" class="sort-up"></a>
                                            <a href="#" title="Sort down" class="sort-down"></a>
                                    </span>
                                    Fones (Comercial / Celular / Fax)
                                </th>
                                <th scope="col">
                                    <span class="column-sort">
                                            <a href="#" title="Sort up" class="sort-up"></a>
                                            <a href="#" title="Sort down" class="sort-down"></a>
                                    </span>
                                    Situação
                                </th>
                                <th scope="col" class="table-actions">Ações</th>
                        </tr>
                </thead>

                <tbody>

                    <?
                    foreach($query->result() as $row) {

                        ?>
                    <tr>
                        <td class="th table-check-cell"><input type="checkbox" name="selected[]" id="table-selected-1" value="1"></td>
                        <td><?=$row->id_fornecedor?></td>
                        <td><?=$row->razao_social?></td>
                        <td><?=$row->contato?></td>
                        <td>
                            <?
                            if($row->fone_com != "") {
                            ?>
                                <small><img src="<?=base_url()?>public/images/icons/fugue/phone_fix.png" width="16" height="16" class="picto"/><?=$row->fone_com?></small>
                            <?
                            }
                            if($row->fone_cel != "") {
                            ?>
                                / <small><img src="<?=base_url()?>public/images/icons/fugue/phone.png" width="16" height="16" class="picto"/><?=$row->fone_cel?></small>
                            <?
                            }
                            if($row->fone_fax != "") {
                            ?>
                                / <small><img src="<?=base_url()?>public/images/icons/fugue/phone_fix.png" width="16" height="16" class="picto"/><?=$row->fone_fax?></small>
                            <?
                            }
                            ?>
                        </td>
                        <td class="center">

                            <ul class="keywords">
                                <?
                                if($row->ativo == 0) {
                                    ?><li class="red-keyword" id="list_situacao_<?=$row->id_fornecedor?>"><a href="#Ativar()" id="link_situacao_<?=$row->id_fornecedor?>" title="Clique para ativar este fornecedor" class="activeFornecedor with-tip" label="<?=$row->id_fornecedor?>">Inativo</a></li><?
                                } else {
                                    ?><li class="green-keyword" id="list_situacao_<?=$row->id_fornecedor?>"><a href="#Inativar()"  id="link_situacao_<?=$row->id_fornecedor?>" title="Clique para inativar este fornecedor" class="activeFornecedor with-tip" label="<?=$row->id_fornecedor?>">Ativo</a></li><?
                                }
                                ?>

                            </ul>
                        </td>
                        <td class="table-actions">
                            <?=anchor("/cadastros/editar_fornecedor/" . $row->id_fornecedor,"<img src='" . base_url() . "public/images/icons/fugue/pencil.png' width='16' height='16'>",array("class" => "with-tip","title" => "Editar fornecedor"))?>
                        </td>
                    </tr>
                        <?
                    }
                    ?>

                </tbody>

        </table>

        </form>
    
    </div>
    
</section>